//获得API主目录，一般不需要修改
bmapConfig.home_dir = '/static/bmap';
if (bmapConfig.tiles_path.length == 0) {
  bmapConfig.tiles_path = bmapBaseUrl + '/tiles';
}
if (bmapConfig.tiles_satellite_path.length == 0) {
  bmapConfig.tiles_satellite_path = bmapBaseUrl + '/tiles_satellite';
}
if (bmapConfig.tiles_hybrid_path.length == 0) {
  bmapConfig.tiles_hybrid_path = bmapBaseUrl + '/tiles_hybird';
}

//调试日志，请保留
function bmapLog(s) {
  // if (typeof console != 'undefined') console.log('>>> ' + s);
}

/**
 * 导入js
 */
if (!bmapConfig.onlineMapAppKey) {
  alert('在线地图必须有秘钥，无秘钥时使用离线地图');
}

// 百度在线地图https协议时需配置该项，否则访问的是http请求导致报错

window.HOST_TYPE = location.protocol === 'https:' ? 1 : '0';

var bmapApiJS =
  bmapConfig.useOnlineMap && bmapConfig.onlineMapAppKey
    ? '//api.map.baidu.com/getscript?v=3.0&ak=' + bmapConfig.onlineMapAppKey
    : 'static/bmap/map3.0.js';
var html = '<script type="text/javascript" src="' + bmapApiJS + '"></script>';
document.write(html);

/**
 * 加载测距和测面积工具
 */
$.getScript('static/bmap/library/LuShu.js');
$.getScript('static/bmap/library/DistanceTool.js');
$.getScript('static/bmap/library/GeoUtils_min.js');
